﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    public class ArtWorkInfo
    {
        public ArtWorkInfo()
        {
            ArtWorkName = string.Empty;
            AttachmentList = new List<AttachmentInfo>();
            Spec = string.Empty;
            PrePrice = 0;
            SaleAuct = string.Empty;
            SaleCompany = string.Empty;
            SaleTime = string.Empty;
            ArtWorkName = string.Empty;
            AuctState = string.Empty;
            TransactionPrice = 0;
            Introduction = string.Empty;
        }

        /// <summary>
        /// 作品编号
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 艺术家名称
        /// </summary>
        public string ArtistID { get; set; }

        /// <summary>
        /// 艺术家名称
        /// </summary>
        public string ArtistName { get; set; }


        /// <summary>
        /// 作品名称
        /// </summary>
        public string ArtWorkName { get; set; }

        /// <summary>
        /// 所属分类
        /// </summary>
        public string ArtistCategory { get; set; }
        /// <summary>
        /// 作品规格
        /// </summary>
        public string Spec { get; set; }
        /// <summary>
        /// 拍卖价格
        /// </summary>
        public double PrePrice { get; set; }

        /// <summary>
        /// 拍卖时间
        /// </summary>
        public string SaleTime { get; set; }

        /// <summary>
        /// 拍卖公司
        /// </summary>
        public string SaleCompany { get; set; }

        /// <summary>
        /// 拍卖会
        /// </summary>
        public string SaleAuct { get; set; }

        /// <summary>
        /// 拍卖状态预展，已拍卖，未拍卖
        /// </summary>
        public string AuctState { get; set; }

        /// <summary>
        /// 成交价
        /// </summary>
        public double TransactionPrice { get; set; }

        /// <summary>
        /// 简介
        /// </summary>
        public string Introduction { get; set; }

        /// <summary>
        /// 附件列表
        /// </summary>
        public IList<AttachmentInfo> AttachmentList { get; set; }


        public string AttarchmentString
        {
            get { return ""; }
            set
            {
                AttachmentList.Clear();

                if (!string.IsNullOrEmpty(value))
                {
                    string[] lines = value.Split('|');
                    foreach (var line in lines)
                    {
                        if (line.Length > 0)
                        {
                            string[] _sp = line.Split(':');

                            AttachmentList.Add(new AttachmentInfo { FileName = _sp[0], SaveName = _sp[1] });
                        }
                    }
                }
            }
        }
    }
}
